import axios from "axios"
//创建actions
export default {
    //电影列表请求，通过commit拿到setMovieList方法，将数据传入
    async getMovieList({ commit }) {
        const result = await axios.get("https://pcw-api.iqiyi.com/search/recommend/list?channel_id=1&data_type=1&mode=11&page_id=2&ret_num=48&session=b9fd987164f6aa47fad266f57dffaa6a")
        commit("setMovieList", result.data.data.list)
    },
    //等待在加的异步函数
    waitIncrementAction(context, payload) {
        setTimeout(() => {
            context.commit("waitIncrement", payload)
        }, 2000)

    }
}
